<!--<?php
print <<<EOT
-->
<div id="breadCrumb">
		<img src="$imgpath/$stylepath/thread/home-old.gif" align="absmiddle" />&nbsp;<a href="$db_bfn" title="$db_bbsname">$db_bbsname</a> &raquo; <a href="u.php">用户中心</a> &raquo; 短消息
</div>
<style>
.s3,a.s3{color:#f06f18;}
#set-wrap{width:100%;margin:8px auto 1.5em;line-height:150%}
#set-side{width:170px;float:left;}
#set-content{margin-left:178px;_margin-left:175px;background:$bgcolor; }
#set-content-wrap{float:left; width:100%;}
#set-side-wrap {border:1px solid $tdcolor;background:$bgcolor;}
.set-h2{background:url($imgpath/$stylepath/set-h3.gif) repeat-x;height:30px; line-height:30px;border-bottom:$tdcolor solid 1px;margin:0;padding:0 .6em;font-size:12px;display:block}
.color8{color:#D2C100}
#set-menu{font-size:14px;padding:.6em 0 .6em 1em;margin:0;list-style:none}
#set-menu li{margin:0;padding:.3em 0 0 1.5em;background:url($imgpath/$stylepath/u-fav.gif) no-repeat 0 0.5em;}
#set-menu li a{color:#949494}
#set-menu li.current{background:url($imgpath/$stylepath/u-fav-cur.gif) no-repeat 0 0.5em;}
#set-menu li.current a{color:#707070;font-weight:700}
.set-content-left{margin-right:320px;}
.set-content-right{width:300px;float:right}
.set-table1{line-height:200%}
.set-table1 .tdpr2{padding-right:2em}
#set-content-wrap td{vertical-align:top;}
.set-table2 td{padding:.5em 1em;border-bottom:1px dotted $cbgborder;}
.set-table2 td.td1{text-align:right;padding:.5em 1em;}
.set-tab-table{background:$cbgcolor url($imgpath/$stylepath/set-tab-dot.gif) repeat-x left bottom}
.set-tab-table td{border-bottom:0;padding:.5em 2em;border-right:1px solid $tdcolor;border-left:1px solid $tdcolor}
.set-tab-table td.current{border:1px solid $tdcolor;border-bottom:0;background:$bgcolor}
.set-tab-table td.current a{color:#000;font-weight:700}
.set-tab-box{border:1px solid $tdcolor;border-top:0;padding:.5em 1em}
textarea{font-size:12px;}
.write-newmeg-butt{ float:left;padding-left:1.8em ; background: url($imgpath/$stylepath/write-meg.png) no-repeat 0 center}
</style>
<div id="set-wrap">
	<div id="set-side">
		<div id="set-side-wrap">
			<h2 class="set-h2 b color8">短消息</h2>
			<ul id="set-menu">
				<li id="msg_receivebox">
					<a href="$secondurl">收件箱</a>
				</li>
				<li id="msg_sendbox">
					<a href="$secondurl?action=sendbox">发件箱</a>
				</li>
				<li id="msg_scout">
					<a href="$secondurl?action=scout">消息跟踪</a>
				</li>
				<li>
					<a href="profile.php?action=bbsset&info_type=msg">短消息设置</a>
				</li>
				<li>
					<a style="cursor:pointer;" onclick="return checkset();">清空</a>
				</li>
			</ul>
		</div>
	</div>
<script language="javascript">
setCurrent('msg_$action','','current');
var ifcheck = true;
function CheckAll(form,match) {
	for (var i = 0; i < form.elements.length; i++) {
		var e = form.elements[i];
		if (e.type == 'checkbox' && (typeof match == 'undefined' || e.name.match(match))) {
			e.checked = ifcheck;
		}
	}
	ifcheck = ifcheck == true ? false : true;
}
</script>
	<div id="set-content">
		<div id="set-content-wrap" class="cc">
		<div>
<!--
EOT;
if($action=='receivebox'){print <<<EOT
-->
			<div class="set-tab-table cc">
				<table border="0" cellspacing="0" cellpadding="0" class="fl">
					<tr class="tac" id="infolist">
<!--
EOT;
if($type=='notify'){print <<<EOT
-->
						<td><a style="cursor:pointer" href="$secondurl">个人消息</a>
<!--
EOT;
} else {print <<<EOT
-->
						<td id="base"><a style="cursor:pointer" onclick="showTabs('infolist','base','td','current')">个人消息</a>
<!--
EOT;
}if ($contl > 100) {print <<<EOT
-->
							<font color="red">[您的信箱已满，请删除一些，以查看最新消息]</font>
<!--
EOT;
} print <<<EOT
-->
						</td>
						<td id="public">
							<a onclick="showTabs('infolist','public','td','current')" style="cursor:pointer">群发消息</a>
						</td>
<!--
EOT;
if($type=='notify' || $type == 'newmsg'){print <<<EOT
-->
							<td id="notify"><a onclick="showTabs('infolist','notify','td','current')" style="cursor:pointer">系统通知</a>
<!--
EOT;
} else {print <<<EOT
-->
							<td><a href="$secondurl?type=notify" style="cursor:pointer">系统通知</a>
<!--
EOT;
}print <<<EOT
-->

						</td>
<!--
EOT;
if($winddb['newpm'] > 0) {
if($type == 'newmsg'){print <<<EOT
-->
						<td id="newmsg"><a onclick="showTabs('infolist','newmsg','td','current')" style="cursor:pointer">未读短消息</a></td>
<!--
EOT;
}else{print <<<EOT
-->
						<td><a href="$secondurl?type=newmsg" style="cursor:pointer">未读短消息</a></td>
<!--
EOT;
}
}print <<<EOT
-->
						<td><span class="write-newmeg-butt b"><a href="$secondurl?action=write">写新消息</a></span></td>
					</tr>
				</table>
			</div>
			<div class="set-tab-box cc">
				<form name="del" action="$secondurl" method="post">
				<input type="hidden" name="verify" value="$verifyhash" />
<!--
EOT;
if ($type=='notify' || $type == 'newmsg'){print <<<EOT
-->
				<div id="info_notify" style="display:none">
				<div style="margin:1em 2em;">
					<table width="100%" cellspacing="0" cellpadding="0" class="set-table2">
<!--
EOT;
if ($msgdb_notify) {print <<<EOT
-->
						<tr class="gray">
							<td width="6%">ID</a></td>
							<td width="*">标题</td>
							<td width="25%">时间</td>
							<td width="8%">选定</a></td>
						</tr>
<!--
EOT;
$i = ($page-1) * $permsg;
foreach ($msgdb_notify as $key => $message) {
$i++;
$boldclass = $message['ifnew'] ? 'class="b"' : '';
print <<<EOT
-->
						<tr>
							<td>$i</td>
							<td><a href="$secondurl?action=readn&mid=$message[mid]" $boldclass>$message[title]</a></td>
							<td>$message[mdate]</td>
							<td><input type="checkbox" name="delid[]" value="$message[mid]" /></td>
						</tr>
<!--
EOT;
}}else{print <<<EOT
-->
						<tr>
							<td>暂时没有通知。</td>
						</tr>
<!--
EOT;
}print <<<EOT
-->
				</table></div>$pages</div>
<!--
EOT;
}
if($type == 'base' || $type == 'newmsg'){print <<<EOT
-->
				<div id="info_base" style="display:none">
				<div style="margin:1em 2em;">
					<table width="100%" cellspacing="0" cellpadding="0" class="set-table2">
						<tr><td class="gray"  colspan="5">&nbsp;【信箱状态：目前有短消息<b> $msgcount </b>条；最多可存消息 <b>$_G[maxmsg]</b> 条；使用率 <b>$contl%</b> 】
<!--
EOT;
if($contl>100){print <<<EOT
-->
已满
<!--
EOT;
}print <<<EOT
-->
							</td>
						</tr>
<!--
EOT;
if ($msgdb) {print <<<EOT
-->
						<tr class="gray">
							<td width="6%">ID</a></td>
							<td width="12%">发件人</td>
							<td width="*">标题</td>
							<td width="25%">时间</td>
							<td width="8%">选定</a></td>
						</tr>
<!--
EOT;
$i = ($page-1) * $permsg;
foreach ($msgdb as $key => $message) {
$i++;
$boldclass = $message['ifnew'] ? 'class="b"' : '';
print <<<EOT
-->
						<tr>
							<td>$i</td>
							<td><a href="u.php?action=show&uid=$message[fromuid]">$message[from]</a></td>
							<td><a href="$secondurl?action=read&mid=$message[mid]" $boldclass>$message[title]</a></td>
							<td>$message[mdate]</td>
							<td><input type="checkbox" name="delid[]" value="$message[mid]" /></td>
						</tr>
<!--
EOT;
}}else{print <<<EOT
-->
						<tr>
							<td>暂时没有消息。</td>
						</tr>
<!--
EOT;
}print <<<EOT
-->
				</table></div>$pages</div>
<!--
EOT;
}print <<<EOT
-->
				<div style="margin:1em 2em;display:none" id="info_public">
					<table width="100%" cellspacing="0" cellpadding="0" class="set-table2">
<!--
EOT;
if($pmsgdb || $type == 'newmsg'){print <<<EOT
-->
						<tr class="gray">
							<td width="6%">ID</a></td>
							<td width="*">标题</td>
							<td width="25%">时间</td>
							<td width="8%">选定</a></td>
						</tr>
<!--
EOT;
$i = 0;
foreach ($pmsgdb as $key => $message) {
$boldclass = $message['ifnew'] ? 'class="b"' : '';
$i++;
print <<<EOT
-->
						<tr>
							<td>$i</td>
							<td><a href="$secondurl?action=readpub&mid=$message[mid]" $boldclass>$message[title]</a></td>
							<td>$message[mdate]</td>
							<td><input type="checkbox" name="pdelid[]" value="$message[mid]" /></td>
						</tr>
<!--
EOT;
}}else{print <<<EOT
-->
						<tr>
							<td>暂时没有消息。</td>
						</tr>
<!--
EOT;
}print <<<EOT
-->
					</table>
				</div>
<!--
EOT;
if ($type == 'newmsg') {print <<<EOT
-->
				<div style="margin:1em 2em;display:none" id="info_newmsg">
					<table width="100%" cellspacing="0" cellpadding="0" class="set-table2">
					<tr class="gray3">
						<td width="6%">ID</a></td>
						<td width="12%">发件人</td>
						<td width="*">标题</td>
						<td width="25%">时间</td>
						<td width="8%">选定</a></td>
					</tr>
<!--
EOT;
if ($new_pmsgdb) {print <<<EOT
-->
					<tr><td colspan="5"><b>未读群发短消息</b></td></tr>
<!--
EOT;
	$i=0;
	foreach ($new_pmsgdb as $key => $message) {$i++;
print <<<EOT
-->
					<tr>
						<td>$i</td>
						<td><a href="u.php?action=show&uid=$message[fromuid]">$message[from]</a></td>
						<td><a href="$secondurl?action=readpub&mid=$message[mid]">$message[title]</a></td>
						<td>$message[mdate]</td>
						<td><input type="checkbox" name="pdelid[]" value="$message[mid]" /></td>
					</tr>
<!--
EOT;
	}
}
if ($new_msgdb) {print <<<EOT
-->
					<tr><td colspan="5"><b>未读个人短消息</b></td></tr>
<!--
EOT;
	$i=0;
	foreach ($new_msgdb as $key => $message) {$i++;
print <<<EOT
-->
					<tr>
						<td>$i</td>
						<td><a href="u.php?action=show&uid=$message[fromuid]">$message[from]</a></td>
						<td><a href="$secondurl?action=read&mid=$message[mid]">$message[title]</a></td>
						<td>$message[mdate]</td>
						<td><input type="checkbox" name="delid[]" value="$message[mid]" /></td>
					</tr>
<!--
EOT;
	}
}
if ($new_msgdb_notify) {print <<<EOT
-->
					<tr><td colspan="5"><b>未读系统短消息</b></td></tr>
<!--
EOT;
	$i=0;
	foreach ($new_msgdb_notify as $key => $message) {$i++;
print <<<EOT
-->
					<tr>
						<td>$i</td>
						<td><a href="u.php?action=show&uid=$message[fromuid]">$message[from]</a></td>
						<td><a href="$secondurl?action=readn&mid=$message[mid]">$message[title]</a></td>
						<td>$message[mdate]</td>
						<td><input type="checkbox" name="delid[]" value="$message[mid]" /></td>
					</tr>
<!--
EOT;
	}
}print <<<EOT
-->
					</table>
				</div>
<!--
EOT;
}print <<<EOT
-->
				<div class="tac" style=" padding:1em">
					<input class="bt" type="button" name="chkall" value="全选" onclick="CheckAll(this.form,p_match)" />
					<input class="btn" type="submit" value="提 交" />
					<input name="towhere" type="hidden" value="receivebox" /><!--
					<input name="action" type="radio" value="doread" checked />标记为已读 -->
					<input name="action" type="radio" value="down" />下载
					<input name="action" type="radio" value="del" checked />删除
				</div>
				</form>
<script type="text/javascript">
var p_match = '';
function showTabs(id,select,element,css) {
	var o = getObj(id);
	var t = o.getElementsByTagName(element);
	for (var i = 0; i < t.length; i++) {
		if (t[i].id) {
			var oo = getObj(t[i].id);
			if (t[i].id == select) {
				getObj(t[i].id).className = css;
				getObj('info_'+t[i].id).style.display = '';
			} else {
				getObj(t[i].id).className = '';
				getObj('info_'+t[i].id).style.display = 'none';
			}
		}
	}
	ifcheck = false;
	p_match = select == 'public' ? /^pdelid/ : /^delid/;
	CheckAll(document.del);
	return false;
}
showTabs('infolist','$type','td','current');
</script>
<!--
EOT;
}elseif($action=='sendbox'){print <<<EOT
-->
			<div class="set-tab-table">
				<table border="0" cellspacing="0" cellpadding="0">
					<tr class="tac">
						<td class="current link5 b">发件箱</td>
						<td><span class="write-newmeg-butt b"><a href="$secondurl?action=write">写新消息</a></span></td>
					</tr>
				</table>
			</div>
			<div class="set-tab-box">
			<form name="del" action="$secondurl" method="post">
			<input type="hidden" name="verify" value="$verifyhash" />
			<div style="margin:1em 2em;" id="info_base">
				<table width="100%" cellspacing="0" cellpadding="0" class="set-table2">
<!--
EOT;
if ($msgdb) {print <<<EOT
-->
					<tr class="gray">
						<td width="6%">ID</a></td>
						<td width="12%">收件人</td>
						<td width="*">标题</td>
						<td width="25%">时间</td>
						<td width="8%">选定</a></td>
					</tr>
<!--
EOT;
$i = ($page - 1) * $permsg;
foreach ($msgdb as $key => $message) {
$i++;
print <<<EOT
-->
					<tr>
						<td>$i</td>
						<td><a href="u.php?action=show&uid=$message[touid]">$message[to]</a></td>
						<td><a href="$secondurl?action=readsnd&mid=$message[mid]">$message[title]</a></td>
						<td>$message[mdate]</td>
						<td><input type="checkbox" name="delid[]" value="$message[mid]" /></td>
					</tr>
<!--
EOT;
}}else{print <<<EOT
-->
					<tr>
						<td>暂时没有消息。</td>
					</tr>
<!--
EOT;
}print <<<EOT
-->
				</table>
			</div>$pages
			<div class="tac" style=" padding:1em">
				<input class="bt" type="button" name="chkall" value="全选" onclick="CheckAll(this.form)" />
				<input class="btn" type="submit" value="提 交" />
				<input name="towhere" type="hidden" value="sendbox" />
				<input name="action" type="radio" value="down" />下载
				<input name="action" type="radio" value="del" checked />删除
			</div></form><br />
<!--
EOT;
} elseif ($action == 'scout') {print <<<EOT
-->
			<div class="set-tab-table">
				<table border="0" cellspacing="0" cellpadding="0">
					<tr class="tac">
						<td class="current link5 b">消息跟踪</td>
						<td><span class="write-newmeg-butt b"><a href="$secondurl?action=write">写新消息</a></span></td>
					</tr>
				</table>
			</div>
			<div class="set-tab-box">
			<form name="del" action="$secondurl" method="post">
			<input type="hidden" name="verify" value="$verifyhash" />
			<div style="margin:1em 2em;" id="info_base">
				<table width="100%" cellspacing="0" cellpadding="0" class="set-table2">
					<tr class="gray">
						<td width="6%">ID</a></td>
						<td width="12%">收件人</td>
						<td width="*">标题</td>
						<td width="25%">时间</td>
						<td width="8%">已读</td>
						<td width="8%">选定</a></td>
						<td width="8%">编辑</td>
					</tr>
<!--
EOT;
$i = ($page-1) * $permsg;
foreach ($msgdb as $key => $message) {
$i++;
print <<<EOT
-->
					<tr>
						<td>$i</td>
						<td><a href="u.php?action=show&uid=$message[touid]">$message[to]</a></td>
						<td><a href="$secondurl?action=readscout&mid=$message[mid]">$message[title]</a></td>
						<td>$message[mdate]</td>
						<td>
<!--
EOT;
if($message['ifnew']){print <<<EOT
-->
							<font color="red">否</font>
<!--
EOT;
}else{print <<<EOT
-->
							是
<!--
EOT;
}print <<<EOT
-->
						</td>
<!--
EOT;
if($message['ifnew']==0 && $message['to'] != $windid){print <<<EOT
-->
						<td>--</td><td><br /></td>
<!--
EOT;
}else{print <<<EOT
-->
						<td><input type="checkbox" name="delid[]" value="$message[mid]" /></td>
						<td><a href="message.php?action=write&edmid=$message[mid]">编辑</a></td>
<!--
EOT;
}print <<<EOT
-->
					</tr>
<!--
EOT;
}print <<<EOT
-->
				</table>
			</div>$pages
			<div class="tac" style=" padding:1em">
				<input class="bt" type="button" name="chkall" value="全选" onclick="CheckAll(this.form)" />
				<input class="btn" type="submit" value="提 交" />
				<input name="towhere" type="hidden" value="scout" />
				<input name="action" type="radio" value="down" />下载
				<input name="action" type="radio" value="del" checked />删除
			</div></form><br />
<!--
EOT;
} elseif (in_array($action,array('read','readsnd','readscout','readpub','readn'))) {print <<<EOT
-->
			<div class="set-tab-table">
				<span class="fr" style="margin-right:3px"><a href="javascript:void(0)" onclick="msggoto('previous');">上一条</a> <a href="javascript:void(0)" onclick="msggoto('next');">下一条</a></span>
				<table border="0" cellspacing="0" cellpadding="0">
					<tr class="tac">
<!--
EOT;
if ($action == 'read') {print <<<EOT
-->
						<td><a href="message.php">个人消息</a></td>
<!--
EOT;
} elseif ($action == 'readpub') {print <<<EOT
-->
						<td><a href="message.php?action=receivebox&type=public">群发消息</a></td>
<!--
EOT;
} elseif ($action == 'readsnd') {print <<<EOT
-->
						<td><a href="message.php?action=sendbox">发件箱</a></td>
<!--
EOT;
} elseif ($action == 'readn') {print <<<EOT
-->
						<td><a href="message.php?action=receivebox&type=notify">系统通知</a></td>
<!--
EOT;
} else {print <<<EOT
-->
						<td><a href="message.php?action=scout">消息跟踪</a></td>
<!--
EOT;
}print <<<EOT
-->
						<td class="current link5 b">查看信息</td>
					</tr>
				</table>
			</div>
			<div class="set-tab-box">
			<div style="margin:1em 2em;" id="info_base">
				<table width="100%" cellspacing="0" cellpadding="0" class="set-table2">
					<tr>
						<td class="td1" width="13%"><font color="#5A6633">
<!--
EOT;
if($action == 'readscout' || $action == 'readsnd'){print <<<EOT
-->
		收件人:
<!--
EOT;
}else{print <<<EOT
-->
		发件人:
<!--
EOT;
}print <<<EOT
-->
						</font></td>
						<td><a href="u.php?action=show&uid=$msginfo[withuid]">$msginfo[username]</a></td>
					</tr>
					<tr>
						<td class="td1" width="12%"><font color="#5A6633">标题:</font></td>
						<td>$msginfo[title]</td>
					</tr>
					<tr>
						<td class="td1" width="12%"><font color="#5A6633">时间:</font></td>
						<td>$msginfo[mdate]</td>
					</tr>
					<tr>
						<td class="td1" width="12%"><font color="#5A6633">内容:</font></td>
						<td>$msginfo[content]</td>
					</tr>
					<tr>
						<td class="td1"><font color="#5A6633">选项:</font></td>
						<td><font color="#5A6633">
<!--
EOT;
if($action=='read'){print <<<EOT
-->
							[<a href="$secondurl?action=chatlog&withuid=$msginfo[withuid]">通信记录</a>]
							[<a href="$secondurl?action=unread&mid=$msginfo[mid]&verify=$verifyhash">标记未读</a>]
							[<a href="$secondurl?action=write&remid=$msginfo[mid]">回复</a>]
							[<a href="$secondurl?action=write&transmit=$msginfo[mid]">转发</a>]
							[<a href="$secondurl?action=del&towhere=receivebox&delids=$msginfo[mid]&verify=$verifyhash">删除</a>]
							[<a href="message.php?action=receivebox">返回</a>]
<!--
EOT;
}elseif($action=='readpub'){print <<<EOT
-->
							[<a href="$secondurl?action=del&towhere=receivebox&pdelids=$msginfo[mid]&verify=$verifyhash">删除</a>]
							[<a href="message.php?action=receivebox&type=public">返回</a>]
<!--
EOT;
}elseif($action=='readn'){print <<<EOT
-->
							[<a href="$secondurl?action=del&towhere=receivebox&delids=$msginfo[mid]&verify=$verifyhash">删除</a>]
							[<a href="message.php?action=receivebox&type=notify">返回</a>]
<!--
EOT;
}elseif($action=="readsnd"){print <<<EOT
-->
							[<a href="$secondurl?action=chatlog&withuid=$msginfo[withuid]">通信记录</a>]
							[<a href="$secondurl?action=write&touid=$msginfo[withuid]">另发</a>]
							[<a href="$secondurl?action=write&transmit=$msginfo[mid]">转发</a>]
							[<a href="$secondurl?action=del&towhere=sendbox&delids=$msginfo[mid]&verify=$verifyhash">删除</a>]
							[<a href="message.php?action=sendbox">返回</a>]
<!--
EOT;
}elseif($action=="readscout"){print <<<EOT
-->
							[<a href="$secondurl?action=chatlog&withuid=$msginfo[withuid]">通信记录</a>]
							[<a href="$secondurl?action=write&touid=$msginfo[withuid]">另发</a>]
							[<a href="$secondurl?action=write&transmit=$msginfo[mid]">转发</a>]
							[<a href="$secondurl?action=del&towhere=scout&delids=$msginfo[mid]&verify=$verifyhash">删除</a>]
							[<a href="message.php?action=scout">返回</a>]
<!--
EOT;
}print <<<EOT
-->
						</font>
						</td>
					</tr>
				</table>
			</div></div>
<script language="JavaScript">
function msggoto(type) {
	ajax.send('pw_ajax.php?action=msggoto&from=$action&mid=$mid&type=' + type, '', function() {
		var rText = ajax.request.responseText.split('\t');
		if (rText[0] == 'ok') {
			location.href = 'message.php?action=$action&mid=' + rText[1];
		} else if (rText[0] == 'none') {
			showDialog("warning",type == 'next' ? '已经是最后一条了!' : '已经是第一条了!!');
		} else {
			ajax.guide();
		}
	});
}
</script>
<!--
EOT;
}elseif($action == 'chatlog'){print <<<EOT
-->
			<div class="set-tab-table">
				<table border="0" cellspacing="0" cellpadding="0">
					<tr class="tac">
						<td class="current link5 b">与 {$m[username]} 的通信记录</td>
					</tr>
				</table>
			</div>
			<div class="set-tab-box">
			<form action="$secondurl" method="post">
			<input type="hidden" name="verify" value="$verifyhash" />
			<input type="hidden" name="action" value="dellog" />
			<input type="hidden" name="withuid" value="$withuid" />
			<div style="margin:1em 2em;" id="info_base">
				<table width="100%" cellspacing="0" cellpadding="0" class="set-table2" style="table-layout:fixed">
<!--
EOT;
foreach($msgdb as $key => $value){print <<<EOT
-->
					<tr>
						<td style="line-height:150%; width:100%">
						<div>
							<span class="fr gray">{$u_name[$value[mtype]]} - $value[mdate]  <input type="checkbox" name="selid[]" value="$value[mid]" /></span>
							<span class="s2"><b>{$value[title]}</b></span><br />{$value[content]}</div>
						</td>
					</tr>
<!--
EOT;
}print <<<EOT
-->
			</table></div>{$pages}
			<div class="tac" style=" padding:1em">
				<input class="bt" type="button" name="chkall" value="全选" onclick="CheckAll(this.form)" />
				<input class="btn" type="submit" value="删除" name="Submit" />
			</div>
		</form><div>
<!--
EOT;
}elseif($action=='write'){print <<<EOT
-->
			<script language="JavaScript" src="js/wind_editor.js"></script>
			<div class="set-tab-table">
				<table border="0" cellspacing="0" cellpadding="0">
					<tr class="tac">
						<td class="current link5 b">写新消息</td>
					</tr>
				</table>
			</div>
			<div class="set-tab-box">
			<form name="FORM" action="$secondurl" method="post" onsubmit="return checkCnt();">
<!--
EOT;
if($edinfo){ print <<<EOT
-->
			<input type="hidden" name="edmid" value="$edmid" />
<!--
EOT;
} print <<<EOT
-->
			<input type="hidden" name="action" value="write" />
			<input type="hidden" name="step" value="2" />
			<input type="hidden" name="verify" value="$verifyhash" />
			<div style="margin:1em;" id="info_base">
				<table width="100%" cellspacing="0" cellpadding="0" class="set-table2">
				<tr>
					<td class="td1" width="20%">用户名</td>
					<td><input class="input" type="text" name="pwuser"  style="width:50%"  size="73" $msgid />
					</td></tr>

<tr><td class="td1" width="20%">其他</td>
<td>
<div id="menu_show" style="display:none;"></div>
<a class="bta" id="td_face" style="cursor:pointer;" onClick="showDefault();" align="absmiddle" unselectable="on">添加表情</a> <a class="bta" id="newdraft" onclick="opendraft(this.id);">草稿箱</a>
<!--
EOT;
if($frienddb){print <<<EOT
-->
				<span class="bta" onClick="getObj('tofriend').style.display='';">好友群发</span>
				</td></tr>

				<tr id="tofriend" style="display:none">
					<td class="td1">好友群发</td>
					<td>
<!--
EOT;
foreach($frienddb as $key=>$val){print <<<EOT
-->
						<input type="checkbox" name="touid[]" value="$val[friendid]" />$val[username]
<!--
EOT;
}print <<<EOT
-->
						<span class="bta" style="cursor:pointer;" onClick="CheckAll(document.FORM,'touid')">全 选</span>
<!--
EOT;
}print <<<EOT
-->
			</td>

				</tr>



				<tr>
					<td class="td1">标题</td>
					<td><input class="input" type="text" name="msg_title" style="width:50%" size="73" value="$subject" /></td>
				</tr>
<!--
EOT;
if($db_gdcheck & 8){print <<<EOT
-->
				<tr>
					<td class="td1">认证码</td>
					<td><input class="input" type="text" name="gdcode" size="8" onfocus="try{opencode('menu_gd',this)}catch(e){}" /><span style="cursor:pointer; margin-left:3px" onclick="this.previousSibling.focus();">点此显示验证码</span>
					<div class="menu" id="menu_gd" style="visibility:hidden;"><img src="ck.php?" align="absmiddle" style="cursor:pointer;" id="ckcode" title="看不清楚，换一张" /></div></td>
				</tr>
<!--
EOT;
}if($msgq && $db_question){
$qkey = array_rand($db_question);
print <<<EOT
-->
				<tr>
					<td class="td1">验证问题<br />问题：{$db_question[$qkey]}</td>
					<td><input class="input" type="text" name="qanswer" /> 正确答案：{$db_answer[$qkey]}<input type="hidden" name="qkey" value="$qkey" /></td>
				</tr>
<!--
EOT;
}print <<<EOT
-->
				<tr>
					<td class="td1">内容<br /><br />
					<div id="menu_face" class="menu" style="display:none;"></div>
					<script language="javascript">
						var imgpath   = '$imgpath';
						var stylepath = '$stylepath';
					</script>
<!--
EOT;
if(R_P==D_P){print <<<EOT
-->
					<script language="JavaScript" src="data/bbscache/face.js"></script>
<!--
EOT;
}else{
$facedb=readover(D_P."data/bbscache/face.js");
print <<<EOT
-->
					<script language="JavaScript">
					$facedb
					</script>
<!--
EOT;
}print <<<EOT
-->
				<td>
<!--
EOT;
require_once PrintEot('editor');
print <<<EOT
-->
					<div style="margin:4px 0 2px"><input type="checkbox" name="ifsave" value="Y" />保存到发件箱中
					</div>
				</td>
			</tr>
		</table></div>
		<script language="JavaScript" src="js/post.js"></script></td>
		<div class="tac" style=" padding:1em">
			按 Ctrl+Enter 直接提交
			<input class="btn" type="submit" value="提 交" name="Submit" />
		</div>
	</form><br />
<!--
EOT;
}print <<<EOT
-->
</div></div></div></div>
<script language="JavaScript">
cnt = 0;
function checkCnt() {
	document.FORM.Submit.disabled = true;
	cnt++;
	if (cnt != 1) {
		showDialog("warning","Submission Processing. Please Wait");
		return false;
	}
}
function checkset() {
	if (confirm("将删除收件箱和发件箱内所有消息，请确认！")) {
		window.location=('$B_url/message.php?action=clear&verify=$verifyhash');
	} else {
		return false;
	}
}
</script>
</div>
<!--
EOT;
?>-->